<?php
class Language extends Controller {
    public function index() {
        error_reporting(E_ALL);
        $data["partnerlang"]=$this->config->item("partnerlang");
        $this->load->model("adminlanguage_model");
        $this->load->library('breadcrumb');
        $this->breadcrumb->seperator='<div class="breadcrumb_divider"></div>';
        $this->breadcrumb->addCrumb('Home', base_url()."secu/admin/home");
        $this->breadcrumb->addCrumb('Language Manager',"#");
        $data['breadcrumb'] = $this->breadcrumb->makeBread();  
        //$this->template->set('title', "Add New Hotel");
        $data['langlbl_arr'] = $this->adminlanguage_model->getLanguageDetails();
        
        $this->template->load('admintemplate', 'language/index', $data);
    }

    public function editlabel() {
        $id = $this->uri->segment(4);
        $lang = $this->uri->segment(5);
        $this->load->model('adminlanguage_model');
        $data['lang_arr'] = $this->adminlanguage_model->getLabelByLang($id, $lang);
        $data['id'] = $id;
        $data['lang'] = $lang;
        $this->template->load('admintemplate', 'language/editlang', $data);
    }

    public function updatelabel()
    {
        $data_arr = $_POST;
        $this->load->model('adminlanguage_model');
        $this->adminlanguage_model->updateLabels($data_arr);
        redirect('secu/language/index');
    }
}
?>
